<?php
/**
 * Create By: PhpStorm
 * User: yuanxuncheng
 * File: GetAdPosition.php
 * Date: 2017/1/2
 * Time: 23:13
 */

namespace app\home\model\page\shop;

use app\api\model\dao\AdPosition;
use app\library\Error;
use app\library\PageBase;

class GetAdPosition extends PageBase
{

    private $objAdPosition;

    public function __construct()
    {
        parent::__construct();

        $this->objAdPosition = new AdPosition();
    }


    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            header('Location:/home/loginpage');
            return $this->getRes(Error::ERR_NO_AUTH);
        }

        try {
            $ret = $this->objAdPosition->getAdPosition();
        } catch (\think\Exception $e) {
            return $this->getRes(Error::ERR_SYS);
        }


        $this->data = $ret;
        return $this->getRes();
    }
}
